﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace Mimoza.Apps.Console.Commands
{
    abstract public class BaseConsoleCommand : INotifyPropertyChanged
    {
        private bool m_Enabled = false;
        private bool m_Visible = false;
        protected bool m_IsDefault = false;

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        public bool IsDefault
        {
            get { return m_IsDefault; }
        }

        public bool Enabled 
        {
            get { return m_Enabled; }
            set {
                if (m_Enabled != value)
                {
                    m_Enabled = value;
                    NotifyPropertyChanged("Enabled");
                }
            }
        }
        public bool Visible
        {
            get { return m_Visible; }
            set
            {
                if (m_Visible != value)
                {
                    m_Visible = value;
                    NotifyPropertyChanged("Visible");
                }
            }
        }

        abstract public void Execute();
    }
}
